#pragma once
#include <QString>
#include <QWidget>
#include "IDefine.h"

#if WIN32
#include <Windows.h>
#include <winuser.h>

struct tWebCommandPreKeyPressed {
	intptr_t			m_rootwindow;	//
	MSG				m_message;		//
	bool			m_focus_edit;	//
	bool			m_is_system_key;//
	bool			m_ime_mode;		// 表明当前正处于中文输入法模式
	bool			m_req_layout;	// 请求给与一个位置,即QB收到后向browser发送kWebCommandImeWindowPos消息
	unsigned int	m_modifiers;	//
	unsigned int	m_event_type;	//
	unsigned short	m_character;	//
	unsigned short	m_unmodified_character;
	wchar_t			m_result_str[256];
};
typedef tWebCommandPreKeyPressed tWebCommandPostKeyPressed;
#endif



///expose main UI elements
/// TODO:using char*?
class KeySearchWidget;
class S_GUIFRAME_EXPORT IMainFrame
{
public:
    virtual int existCmdWindow(int cmdId, const QString& params, bool enableParam = true) = 0;
    virtual int openCmdWindow(int cmdId, const QString& params, QWidget* widget, const QString& title, bool popup = false) = 0;
    virtual void activateCmdWindow(int windowId) = 0;
    virtual void updateWindowTitle(int windowId, const QString& title) = 0;
    virtual void setNetworkStatus(int status) = 0;
    virtual void setMsgCenterNotify(int count) = 0;
    virtual void setCommonPageNotify(int* ids, int size, int type) = 0;
    virtual void setIasMenuNotify(const QString& iasmenu) = 0;
	virtual	KeySearchWidget* searchWidget() = 0;
	virtual QWidget* cmdWindow(int tabid) = 0;
};
